﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace RequirementAndBug.DAL.Models
{
    /// <summary>
    /// 用户表
    /// </summary>
    public class REQUser
    {        
        [Key]
        [Display(Name = "主键", Order = 1)]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int UserID
        {
            get;
            set;
        }

        [Display(Name = "登录账号", Order = 2)]
        [Required(ErrorMessage = "不能为空")]
        [StringLength(30, ErrorMessage = "长度不可超过30")]
        public string UserCode
        {
            get;
            set;
        }

        [Display(Name = "密码", Order = 3)]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "不能为空")]
        [StringLength(50, ErrorMessage = "长度不可超过50")]
        public string Password
        {
            get;
            set;
        }
        [ScaffoldColumn(false)] 
        [Display(Name = "昵称", Order = 4)]
        [StringLength(20, ErrorMessage = "长度不可超过20")]
        public string NickName
        {
            get;
            set;
        }

        [ScaffoldColumn(true)] 
        [Display(Name = "状态", Order = 6)]
        public int? Status
        {
            get;
            set;
        }


        [Display(Name = "创建时间", Order = 5)]
        public DateTime? CreateTime
        {
            get;
            set;
        }
      
        /// <summary>
        /// 用户类型 0普通用户，1管理员，2浏览人员
        /// </summary>
        [Display(Name = "用户类型", Order = 6)]
        public int? UserType
        {
            get;
            set;
        }
        ///// <summary>
        ///// 建立用户与需求的多对多关系
        ///// </summary>
        //public List<REQRequirement> Requirements
        //{
        //    get;
        //    set;
        //}
               
        public virtual REQRole Role
        {
            get;
            set;
        }

    }
}